package com.itbupt.infrastructure.persistent.dao;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import com.itbupt.infrastructure.persistent.po.RaffleActivityAccountDay;
import org.apache.ibatis.annotations.Mapper;

/**
 * @Author dingchang
 * @Date 2025/4/2 16:22
 * @Description: 抽奖活动账户表-日次数Dao
 */

@Mapper
public interface IRaffleActivityAccountDayDao {

    /**
     * 更新抽奖活动账户表-日次数
     * @param raffleActivityAccountDay
     * @return 影响行数
     */
    int updateActivityAccountDaySubtractionQuota(RaffleActivityAccountDay raffleActivityAccountDay);

    /**
     * 新建一条抽奖活动账户记录-日次数
     * @param raffleActivityAccountDay
     */
    void insertActivityAccountDay(RaffleActivityAccountDay raffleActivityAccountDay);

    /**
     * 查询抽奖活动日信息
     * @param raffleActivityAccountDayReq
     * @return
     */
    @DBRouter
    RaffleActivityAccountDay queryActivityAccountDayByUserId(RaffleActivityAccountDay raffleActivityAccountDayReq);

    /**
     * 查询今天抽奖了多少次： 日次数减去剩余次数
     * @param raffleActivityAccountDay RaffleActivityAccountDay
     * @return Integer
     */
    @DBRouter
    Integer queryRaffleActivityAccountDayPartakeCount(RaffleActivityAccountDay raffleActivityAccountDay);

    /**
     * 更新抽奖活动账户-日次数 - 增加额度
     * @param raffleActivityAccountDay
     */
    void addAccountQuota(RaffleActivityAccountDay raffleActivityAccountDay);

}
